<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2>统计数据</h2>
<form action="<{u('Game/agentCount?query=1')}>" method="post" >
用户创建日期:<input type="text" id="createDate" name="createDate"  placeholder="YYYY-MM-DD"  /> - <input type="text" id="createDate2" name="createDate2"  placeholder="YYYY-MM-DD"  /><br />
开房日期:<input type="text" id="gameDate" name="gameDate"  placeholder="YYYY-MM-DD" /> - <input type="text" id="gameDate2" name="gameDate2"  placeholder="YYYY-MM-DD" /><br />
<button type="submit" >提交</button>
</form>



<script src="/Public/js/jquery-2.1.4.min.js"></script>
<script src="/Public/My97DatePicker/WdatePicker.js"></script>
<script>
    /**
     * 日期联动
     * @param start
     * @param end
     */
    function datePickter(start,end,isDate){
        if(isDate){
            dateFmt='yyyy-MM-dd';
        }else{
            dateFmt='yyyy-MM-dd HH:mm';
        }
        if( end !== undefined && end ) {
            $("#"+start).focus(function(){
                WdatePicker({
                    onpicked:function(){
                        $("#"+end).focus()
                    },
                    maxDate:'#F{$dp.$D('+end+')}',
                    dateFmt:dateFmt
                })
            });
            $("#" + end).focus(function () {
                WdatePicker({
                    dateFmt: dateFmt,
                    minDate: '#F{$dp.$D(' + start + ')}'
                })
            });
        }else {
            $("#"+start).focus(function(){
                WdatePicker({dateFmt:dateFmt});
            });
        }
    }
    datePickter('gameDate','gameDate2',true);
    datePickter('createDate','createDate2',true);

</script>
</body>
</html>